From: Andrea Corallo Date: Wed, 20 Mar 2024 13:49:28 +0000 (+0100) Subject: ; * lisp/emacs-lisp/comp.el: Add a simple sanitizer usage example. X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~14^2~18^2~2194 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e2fec514fd22e61c2a4e9343056aa744e93203a1;p=emacs.git ; * lisp/emacs-lisp/comp.el: Add a simple sanitizer usage example. --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index d7830597709..7e8d4e15e0a 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3017,6 +3017,18 @@ These are substituted with a normal `set' op." ;; the variable tested by the conditional branch is of the predicted ;; value type and signal an error otherwise. +;;; Example: +;; Assuming we want to compile 'test.el' and test function `foo' defined +;; into it. + +;; Native compile 'test.el' instrumenting it for sanitizer usage. +;; (let ((comp-sanitizer-emit t)) +;; (load (native-compile "test.el"))) + +;; Run `foo' with the sanitizer active. +;; (let ((comp-sanitizer-active t)) +;; (foo)) + (defvar comp-sanitizer-emit nil "Gates the sanitizer pass. This is intended to be used only for development and verification of